<?php
global $base_path, $user;
$node = $items['node'];
$form = $items['form'];
$top_pic = file_create_url(image_style_url('250x170', $node->field_exp_photos['und'][0][uri]));

$price_model = $node->field_pricing_model['und'][0]['value'];
$product_id = $node->field_product[LANGUAGE_NONE][0]['product_id'];
$product = commerce_product_load($product_id);
$unit = t(" hours");
$account = user_load($node->uid);
if($node->field_pricing_model['und'][0]['value'] == 1) {
  $unit = t(" days");
}
?>
<div class="row">
<div class="span8">
<?php print drupal_render($form); ?>
</div>
    <div class="span3" style="margin-top: 20px;">
        <div class="trip-info">
            <div class="trip-image">
                <img src="<?php print $top_pic; ?>" />
            </div>
            <h1 class="trip-title">
                <?php print $node->title; ?>
            </h1>
            <div class="trip-guide">
              <?php print t('with'); ?>&nbsp;&nbsp;<?php print $account->name;?>
            </div>
            <div class="trip-info-detail">
              <?php print $node->field_price['und'][0]['value']; ?>
              <?php print $product->commerce_price[LANGUAGE_NONE][0]['currency_code'] == 'USD' ?  '$' : '￥'; ?>
              &nbsp;<?php print $price_model == 1 ? t('per person') : t('total') ?>
              &nbsp;for&nbsp;<?php print $node->field_duration['und'][0]['value'] . $unit; ?>
            </div>
            <div class="Your-info">
                <?php print t('You'); ?>&nbsp;<?php print $user->name; ?>(<?php print $user->mail; ?>)
            </div>
        </div>
        <div class="editable_content">
            <?php echo $node->notice_text; ?>
        </div>
    </div>
</div>
<script type="text/javascript">
    jQuery(document).ready(function() {
       jQuery("#edit-num").change(function() {
           if(jQuery("input[name='mode']").val() == 1) {
               var price = parseFloat(jQuery("input[name='price']").val()) * jQuery(this).val();
               jQuery("#book_money").html(price.toFixed(2));
			   var fee = parseFloat(jQuery("input[name='fee']").val()) * jQuery(this).val();
               jQuery("#book_fee").html(fee.toFixed(2));
			   var total = price + fee;
			   jQuery("#book_total").html(total.toFixed(2));
           }
       }).trigger('change');
    });
</script>
